<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
		<title>我的档案</title>
		<link rel="stylesheet" type="text/css" href="css/main.css" />
		<link rel="stylesheet" type="text/css" href="css/archives.css" />
		<script src="js/rem.js"></script>
	</head>

	<body>
		<div class="main" id="main" v-cloak>
			<div>
				<span>入学时间</span>
				<span>{{main_all.in_time}}</span>
			</div>
			<div>
				<span>邮箱</span>
				<input type="text" name="" id="email" :value="main_all.email" />
			</div>
			<div>
				<span>联系电话</span>
				<input type="text" name="" id="mobile" :value="main_all.mobile" />
			</div>
		</div>
		<div class="but">
			保&nbsp;存
		</div>
		<script src="js/jquery-1.9.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/common.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/vue.min.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			getOpenId();
			var email = $("#email").val(),
				mobile = $("#mobile").val();
			var callback = function() {
				alert(open_id);
			}
			//调用我的档案接口
			$.ajax({
				url: apiPath + 'index/my-file',
				type: 'post',
				dataType: 'json',
				data: {
					open_id: open_id,
					flagsign: 1
				},
				success: function(data) {
					var main = new Vue({
						el: '#main',
						data: {
							main_all: data.returnData,
						},
					});
				}
			});
			$(".but").click(function() {
				var email = $("#email").val(),
					mobile = $("#mobile").val();
				//调用修改我的档案接口
				$.ajax({
					url: apiPath + 'index/update-my-file',
					type: 'post',
					dataType: 'json',
					data: {
						open_id: open_id,
						mobile: mobile,
						email: email,
						flagsign: 1
					},
					success: function(data) {
						window.location.href = "archives.html";
					}
				});
			})
		</script>
	</body>

</html>